﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Rung.Soft.Jx3Tookit.Business.Addon
{
    public abstract class AddonBase: IAddon
    {
        public abstract string Name { get; }
        public abstract int Order { get; }
        public UserControl Control { get; set; }

        private TabPage tabPage;
        public TabPage TabPage
        {
            get { return tabPage; }
        }

        public AddonBase()
        {
            //this.Init();
        }

        //public AddonBase(ControlBase c)
        //{
        //    this.Control = c;
        //    this.Init();
        //}

        public virtual void Init()
        {
            this.Control.Dock = DockStyle.Fill;

            this.tabPage = new TabPage();
            this.tabPage.Controls.Add(this.Control);
        }

        public void Load()
        {
            this.tabPage.Text = this.Name;
        }
    }
}
